﻿<!DOCTYPE html>
<html lang="en">
<head>
            <!-- Global site tag (gtag.js) - Google Analytics -->
        <script async src="/static/js/983dccdae0fe48fc996ba3a4be345b54.js"></script>
        <script>
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());
            gtag('config', 'UA-97991439-1');
        </script>
        <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>EXPASSET</title>
    <link rel="shortcut icon" href="/images/expasset/favicon.ico" type="image/x-icon" />
            <link rel="stylesheet" href="/static/css/vendor.7c885ec125c6e6175bf0fb13b80cbd4a.css"/>
        <link rel="stylesheet" href="/static/css/expasset.9595190cc037e2223ac1e06fdebcf0c2.css">
            </head>
<body class="lg-background" data-app-lang="cn" cz-shortcut-listen="true">
{include file="common/head"}
{include file="common/left"}
    <div class="content">
            <div class="contentBgs pay">
        <div class="container">
            <div class="row">
                <div class="transactionHistory">
                    <div class="text-center3">
                        <div class="col-md-12">
                            <h1>将资金转入另一个帐户。</h1>
                            <div class="col col-md-12">
                                <div class="panel panel-default text-center cashWallet" role="alert">
                                    <div class="panel-body">
                                        可用资金:<br><b
                                                class="balance">0.00 USD</b>
                                    </div>
                                </div>
                            </div>
                                                            <div class="transaction">
                                    <form name="app_transfer_user_funds" method="post">
                                    <div class="form-group"><label class="control-label required" for="app_transfer_user_funds_affiliateId">分销联盟ID</label><input type="text" id="app_transfer_user_funds_affiliateId" name="app_transfer_user_funds[affiliateId]" required="required" class="form-control" /></div>
                                    <div id="not-found-error" class="hidden">
                                        <div class="help-block">
                                            <ul class="list-unstyled">
                                                <li>
                                                    <span class="fa fa-exclamation-triangle"></span>
                                                    找不到用户
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                    <input id="affiliate-search-btn" type="button" class="btn btn-info" value="Search"/>
                                    <div id="transfer-hidden">
                                        <div class="form-group">
                                            <label class="control-label required"
                                                   for="transfer-email">电子邮件</label>
                                            <input id="transfer-email" name="transfer_email" class="form-control"
                                                   type="text" disabled>
                                        </div>
                                        <div class="form-group"><label class="control-label required" for="app_transfer_user_funds_amount">金额</label><input type="text" id="app_transfer_user_funds_amount" name="app_transfer_user_funds[amount]" required="required" class="form-control" value="0" /></div>
                                        <div class="form-group"><label class="control-label required" for="app_transfer_user_funds_password">密码</label><input type="password" id="app_transfer_user_funds_password" name="app_transfer_user_funds[password]" required="required" class="form-control" /></div>
                                        <div class="help-block">
                                            <ul class="list-unstyled">
                                                <li>
                                                    <span class="fa fa-exclamation-triangle"></span>
                                                    警告：资金不能被转回。
                                                </li>
                                            </ul>
                                        </div>
                                        <input type="submit" class="btn btn-info" value="Transfer Now"/>
                                    </div>
                                    <input type="hidden" id="app_transfer_user_funds__token" name="app_transfer_user_funds[_token]" value="p0pku92uo2Q8CT1iCRLxhplkmGkHHhUZWhtpig9LyLQ" /></form>
                                </div>
                                                    </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>

        <script src="/static/js/vendor.2d2e3564e312aec015c5.js"></script>
    <script src="/static/js/expasset.8347ade29d93c0ace30e.js"></script>
        <script>
        
    </script>

    <script>
        var affiliateInput = $('#app_transfer_user_funds_affiliateId'),
            affiliateId = affiliateInput.val(),
            searchButton = $('#affiliate-search-btn'),
            searchHandler = function () {
                $.ajax({
                    url: '/cn/affiliate-search',
                    data: {
                        'affiliateId': affiliateInput.val()
                    }
                }).done(function (data) {
                    if (data.hasOwnProperty('email')) {
                        var email = data.email;
                        $('#transfer-email').val(email);
                        $('#transfer-hidden').removeClass('hidden');
                        $('#not-found-error').addClass('hidden');
                    } else {
                        $('#transfer-hidden').addClass('hidden');
                        $('#transfer-email').val('');
                        $('#not-found-error').removeClass('hidden');
                    }
                });
            };

        affiliateInput.keypress(function (event) {
            if (13 === event.which) {
                event.preventDefault();
                searchHandler();
            }
        });

        searchButton.on('click', function () {
            searchHandler();
        });


        if ('' === affiliateId) {
            $('#transfer-hidden').addClass('hidden');
        } else {
            searchButton.trigger('click');
        }
    </script>
</body>
</html>
